//
//  YDYRecommendCell.m
//  DYSisterAPP
//
//  Created by 杨德勇 on 2016/8/8.
//  Copyright © 2016年 杨德勇. All rights reserved.
//

#import "YDYRecommendCell.h"
#import "YDYRecommendTag.h"
#import <UIImageView+WebCache.h>
@interface YDYRecommendCell()
@property (weak, nonatomic) IBOutlet UIImageView *imgView;
@property (weak, nonatomic) IBOutlet UILabel *themeNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *subNumberLabel;

@end

@implementation YDYRecommendCell
-(void)setRecommend:(YDYRecommendTag *)recommend{
    _recommend = recommend;
    
    UIImage *defaultImage = [[UIImage imageNamed:@"defaultUserIcon"] ydy_circleImage];
    //头像
    [self.imgView ydy_setCircleHeader:recommend.image_list PlaceHolderImage:defaultImage];

    //名字
    self.themeNameLabel.text = recommend.theme_name;
    //订阅数
    if (recommend.sub_number > 10000) {
        self.subNumberLabel.text = [NSString stringWithFormat:@"%.1f万人订阅",recommend.sub_number / 10000.0];
    }else{
        self.subNumberLabel.text = [NSString stringWithFormat:@"%zd人订阅",recommend.sub_number];
    }
    
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setFrame:(CGRect)frame{
    frame.origin.x += 2;
    frame.size.width -=4;
    //修改frame来获取分割线
    frame.size.height -= 2;
    
    [super setFrame:frame];
    
}
@end
